* Redesign of Special:Userrights
* Make rev_deleted log entries more intelligible.
* (bug 6943) Added PAGESINCATEGORY: magic word
-
+* (bug 13604) Added Special:ListGroupRights
=== Bug fixes in 1.13 ===
'SkinTemplate' => 'includes/SkinTemplate.php',
'SpecialAllpages' => 'includes/SpecialAllpages.php',
'SpecialBookSources' => 'includes/SpecialBooksources.php',
+ 'SpecialListGroupRights' => 'includes/SpecialListgrouprights.php',
'SpecialMostlinkedtemplates' => 'includes/SpecialMostlinkedtemplates.php',
'SpecialPage' => 'includes/SpecialPage.php',
'SpecialPrefixindex' => 'includes/SpecialPrefixindex.php',
* to ensure that client-side caches don't keep obsolete copies of global
* styles.
*/
-$wgStyleVersion = '132';
+$wgStyleVersion = '133';
# Server-side caching:
--- /dev/null
+<?php
+
+/**
+ * This special page lists all defined user groups and the associated rights.
+ * See also @ref $wgGroupPermissions.
+ *
+ * @addtogroup SpecialPage
+ * @author Petr Kadlec <mormegil@centrum.cz>
+ */
+class SpecialListGroupRights extends SpecialPage {
+
+ var $skin;
+
+ /**
+ * Constructor
+ */
+ function __construct() {
+ global $wgUser;
+ parent::__construct( 'Listgrouprights' );
+ $this->skin = $wgUser->getSkin();
+ }
+
+ /**
+ * Show the special page
+ */
+ public function execute( $par ) {
+ global $wgOut, $wgGroupPermissions, $wgImplicitGroups;
+
+ $this->setHeaders();
+ $this->outputHeader();
+
+ $wgOut->addHTML(
+ Xml::openElement( 'table', array( 'class' => 'mw-listgrouprights-table' ) ) .
+ '<tr>' .
+ Xml::element( 'th', null, wfMsg( 'listgrouprights-group' ) ) .
+ Xml::element( 'th', null, wfMsg( 'listgrouprights-rights' ) ) .
+ '</tr>'
+ );
+
+ foreach( $wgGroupPermissions as $group => $permissions ) {
+ $groupname = htmlspecialchars( $group );
+ if ( in_array( $group, $wgImplicitGroups ) )
+ $grouplink = $groupname;
+ else
+ $grouplink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Listusers' ), $groupname, 'group=' . $group );
+
+ $wgOut->addHTML(
+ '<tr>
+ <td>' .
+ $grouplink .
+ '</td>
+ <td>' .
+ SpecialListGroupRights::formatPermissions( $permissions ) .
+ '</td>
+ </tr>'
+ );
+ }
+ $wgOut->addHTML(
+ Xml::closeElement( 'table' ) . "\n"
+ );
+ }
+
+ /**
+ * Create a user-readable list of permissions from the given array.
+ *
+ * @param $permissions Array of permission => bool (from $wgGroupPermissions items)
+ * @return string List of all granted permissions, separated by comma separator
+ */
+ private static function formatPermissions( $permissions ) {
+ global $wgUser;
+ $r = array();
+ foreach( $permissions as $permission => $granted ) {
+ if ( $granted ) {
+ $permission = htmlspecialchars( $permission );
+ $r[] = wfMsgExt( 'listgrouprights-link', array( 'parseinline' ), $permission );
+ }
+ }
+ sort( $r );
+ $r = implode( wfMsg( 'comma-separator' ), $r );
+
+ return $r;
+ }
+}
'Imagelist' => array( 'SpecialPage', 'Imagelist' ),
'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
'Listusers' => array( 'SpecialPage', 'Listusers' ),
+ 'Listgrouprights' => 'SpecialListGroupRights',
'Statistics' => array( 'SpecialPage', 'Statistics' ),
'Randompage' => 'Randompage',
'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ),
'Imagelist' => array( 'ImageList' ),
'Newimages' => array( 'NewImages' ),
'Listusers' => array( 'ListUsers', 'UserList' ),
+ 'Listgrouprights' => array( 'ListGroupRights' ),
'Statistics' => array( 'Statistics' ),
'Randompage' => array( 'Random', 'RandomPage' ),
'Lonelypages' => array( 'LonelyPages', 'OrphanedPages' ),
'listusers-submit' => 'Show',
'listusers-noresult' => 'No user found.',
+# Special:Listgrouprights
+'listgrouprights' => 'User group rights',
+'listgrouprights-summary' => 'The following is a list of user groups defined on this wiki, with their associated access rights.',
+'listgrouprights-group' => 'Group',
+'listgrouprights-rights' => 'Rights',
+'listgrouprights-link' => "[[{{ns:help}}:Group rights#$1|$1]]",
+
# E-mail user
'mailnologin' => 'No send address',
'mailnologintext' => 'You must be [[Special:Userlogin|logged in]] and have a valid e-mail address in your [[Special:Preferences|preferences]] to send e-mail to other users.',
'listusers-submit',
'listusers-noresult',
),
+ 'listgrouprights' => array(
+ 'listgrouprights',
+ 'listgrouprights-summary',
+ 'listgrouprights-group',
+ 'listgrouprights-rights',
+ 'listgrouprights-link',
+ ),
'emailuser' => array(
'mailnologin',
'mailnologintext',
'logpages' => 'Special:Log',
'allpages' => 'Special:Allpages',
'listusers' => 'Special:Listusers',
+ 'listgrouprights' => 'Special:Listgrouprights',
'emailuser' => 'E-mail user',
'watchlist' => 'Watchlist',
'watching' => 'Displayed when you click the "watch" button and it is in the process of watching',
background-color: #f9f9f9;
border: 1px dashed #aaa;
}
+
+table.mw-listgrouprights-table {
+ border: 1px solid #ccc;
+ border-collapse: collapse;
+}
+
+table.mw-listgrouprights-table tr {
+ vertical-align: top;
+}
+
+table.mw-listgrouprights-table td, table.mw-listgrouprights-table th {
+ padding: 0.5em 0.2em 0.5em 0.2em;
+ border: 1px solid #ccc;
+}